<%= render 'shared/error_messages', :object => f.object %>
<div class="field">
  <%= f.label :name, t("product.name") %><br />
  <%= f.text_field :name %>
</div>
<div class="field">
  <%= f.label :description, t("product.description") %><br />
  <%= f.text_area :description %>
</div>
<div class="field">
  <%= f.label :price, t("product.price") %><br />
  <%= f.text_field :price %>
</div>
<div class="field">
  <%= f.label :category_id, t("product.category") %><br />
  <%= f.select( :category_id, options_from_collection_for_select(@categories, :id, :name, @product.category_id)) %>
</div>
<div class="field">
  <%= f.label :active, t("product.active") %><br />
  <%= f.check_box :active %>
</div>
<div class="field">
  <%= f.label :image, t("product.image") %><br />
  <%= f.file_field :image %>
  <% if @product.image.exists? then %>
    <br />
    <br />
    <%= image_tag @product.image.url(:medium) %>
  <% end %>
</div>